<!DOCTYPE html>
<html>
<head>
<title>商品管理</title>
#include("../include/common.html")
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>商品管理</h5>
            </div>
            <form id="listForm" action="choose" method="get">
                <div class="ibox-content">
                    <!-- 搜索 start -->
                    <div class="form-horizontal clear">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">名称：</label>
                            <div class="col-sm-3"><input class="form-control" type="text" name="name" value="#(name)"></div>
                        </div>
                        <div class="text-center">
                            <input type="submit" class="btn btn-primary btn-w-m" value="查 询">
                            <input type="reset" class="btn btn-primary btn-w-m" value="重 置">
                        </div>
                    </div>
                    <!-- 搜索 end -->
                    <!-- 列表 start -->
                    <div class="form-horizontal clear">
                        <div class="form-group">
                            <div class="col-sm-8">
                                <a href="javascript:;" class="btn btn-primary" id="refreshButton"><i class="fa fa-refresh"></i> 刷新</a>
                            </div>
                        </div>
                        <div class="table-responsive">
                            <table class="table table-bordered" id="listTable">
                                <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>商品分类</th>
                                        <th>商品名称</th>
                                        <th>商品图片</th>
                                        <th>品牌</th>
                                        <th>商品价格</th>
                                        <th>创建日期</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    #for(product : page.list)
                                    <tr>
                                        <td>#(product.id)</td>
                                        <td>#(product.productCategory.name)</td>
                                        <td>#(product.name)</td>
                                        <td><img src="#(imageUrl(product.image))" height="50"/></td>
                                        <td>#(product.brand.name)</td>
                                        <td>#(product.price)</td>
                                        <td>#date(product.createDate,"yyyy-MM-dd")</td>
                                        <td>
                                            <a href="javascript:void(0)" onclick="chooseProduct('#(product.id)','#(product.name)')">[选择]</a>
                                        </td>
                                    </tr>
                                    #end
                                </tbody>
                            </table>
                        </div>
                        <div class="text-center">
                            #pagination(pageNumber = page.pageNumber,totalPages = page.totalPage,pattern = "")
                                #include("../include/pagination.html")
                            #end
                        </div>
                    </div>
                    <!-- 列表 end -->
                </div>
            </form>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
function chooseProduct(productId,productName){
	frameElement.api.opener.chooseProductCall(productId,productName);
	frameElement.api.close();
}

</script>